package top.huxy.boot.mapper;

import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Repository;
import top.huxy.boot.controller.admin.AdminHomeController;
import top.huxy.boot.model.entity.NavSite;
import top.huxy.boot.model.vo.VONavSite;

import java.util.List;

/**
 * (NavSite)表数据库访问层
 *
 * @author HuXY
 * @since 2021-11-26 14:35:59
 */
@Mapper
@Repository
public interface NavSiteMapper {

    List<VONavSite> getNavSiteList();

    void insert(AdminHomeController.DTOSite navSite);

    int getNavCountByName(String grp);

    void insertSiteGroup(String grp);

    String getGrpIdByName(String grp);

    int updateSiteGroup(AdminHomeController.DTOEditGroup dtoEditGroup);

    int updateSite(AdminHomeController.DTOSite site);

    Integer getGroupWeightByName(String target);

    int increaseGroupWeightWhereGreaterOrEqual(int targetWeight);

    int setGroupWeightByGrp(String grp, int weight);

    int increaseGroupWeightWhereGreater(int targetWeight);

    NavSite getItemById(Integer item);

    int increaseItemWeightWhereGreaterOrEqual(Integer grp, Integer targetWeight);

    int increaseItemWeightWhereGreater(Integer grp, Integer targetWeight);

    Integer getMaxItemWeight(Integer grp);

    int setItemWeightAndGrpById(Integer id, Integer grp, Integer weight);

    Integer getMinItemWeight(Integer grp);

    int getGroupSiteCount(Integer id);

    int delSiteGroup(Integer id);

    int clearItemGroup(Integer id);

    int delSite(Integer id);

    VONavSite getNoGroupNavSite();
}

